﻿using System.Collections.Generic;
namespace OpenCompiler.AST
{
	public class TypeCollectionStatement : Statement
	{
		internal TypeCollectionStatement(Statement parent)
			: base(parent)
		{
			this.Types = new List<Statement>();
		}

		public List<Statement> Types { get; private set; }

		public ClassStatement Class(string name)
		{
			var cs = new ClassStatement(this, name);
			this.Types.Add(cs);
			return cs;
		}

		public StructStatement Struct(string name)
		{
			var ss = new StructStatement(this, name);
			this.Types.Add(ss);
			return ss;
		}

		public static implicit operator List<Statement> (TypeCollectionStatement types)
		{
			return types.Types;
		}
	}
}
